﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.ComponentModel.DataAnnotations;
using System.Linq;
using System.Threading.Tasks;

namespace PhotoGallery.Models
{
    public class User
    {
        /// <summary>
        /// 用户ID
        /// </summary>
        [Display(Name="用户ID")]
        public int UId { get; set; }

        /// <summary>
        /// 用户名
        /// </summary>
        [Required]
        [Display(Name="用户名")]
        public string UserName { get; set; }

        /// <summary>
        /// 姓名
        /// </summary>
        [Display(Name = "姓名")]
        public string Name { get; set; }

        /// <summary>
        /// 是否启用
        /// </summary>

        [Display(Name="是否启用")]
        public bool IsEnable { get; set; }

        /// <summary>
        /// 上次登录时间
        /// </summary>

        [Display(Name="上次登陆时间")]
        public DateTime LastLoginTime { get; set; }

        /// <summary>
        /// 上次登陆IP
        /// </summary>
        [Display(Name="上次登陆IP")]
        public string LastLoginIP { get; set; }


        /// <summary>
        /// 失败次数
        /// </summary>
        [Display(Name="连续登陆失败次数")]
        public int FailRetry { get; set; }

        /// <summary>
        /// 密码哈希
        /// </summary>
        [Required(ErrorMessage="密码不能为空")]
        public string PasswdHash { get; set; }

        /// <summary>
        /// 盐
        /// </summary>
        public string Salt { get; set; }

        /// <summary>
        /// 用户创建时间
        /// </summary>
        [Display(Name="账户建立时间")]
        public DateTime CreateDate { get; set; }

    }
}
